package com.xuecheng.feignclient;

import com.xuecheng.model.RestResponse;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


@Slf4j
@Component
public class MediaServiceClientFallbackFactory implements FallbackFactory<MediaServiceClient> {
	@Override
	public MediaServiceClient create(Throwable throwable) {
		return mediaId -> {
			log.error("远程调用媒资管理服务熔断异常：{}", throwable.getMessage());
			return null;
		};
	}
}